<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>组件选项data</title>
    <script src="../vue.js"></script>
    <script src="../vue-router.js"></script>
</head>

<body>
    <div id="app">
        <first></first>
        <first></first>
        <first></first>
    </div>
    <script>
        Vue.component('first',{
            template:'<button @click = "con+=1">{{con}}</button>',
            //data选项必须以函数的形式存在，并且要返回一个对象
            data:function(){
                return {
                    con:0
                }
            }
        })
        var app = new Vue({
            el:'#app',
            data (){
                return {

                }
            },
            components: {
              
            }
        })
    </script>
</body>

</html>